#!/bin/ksh

function Sensor {
	(( $# >= 1 )) || return 255
	local SENSOR="$1" RESULT=''
	shift
	[[ -x "$SENSORS/$SENSOR" ]] || return 255
	for RESULT in $($SENSORS/$SENSOR "$@"); do
		MESSAGE="$MESSAGE $RESULT"
	done
}

readonly MYHOME="$(dirname "$0")"
readonly LOG_PRI='local7.info'
readonly SENSORS="$MYHOME/sensors"

MESSAGE="$(hostname -s)"
#Sensor uptime
#Sensor load 5
#Sensor swap
#Sensor interfaces 'vlan698 8M'
#Sensor cpufreq 1000,1333
#Sensor temperature 'temp0 20,90' 'temp1 20,70'
#Sensor states
#Sensor queues

echo "$MESSAGE" | logger -i -t "ow-sensors" -p "$LOG_PRI"
